<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false"%>
<html>
<head>
    <title>系统配置参数管理</title>
</head>
<body>
<div ng-app="myApp" ng-controller="ConfigCtrl">
    <div class="col-md-6">
    <ui-form key="configEdit" column="2" class="row">
        <input type="hidden" name="id" id="id" value="${sysConfig.id}"/>
        <ui-form-input name="configName" label="参数名称:" value="${sysConfig.configName}"></ui-form-input>
        <ui-form-input name="configValue" label="参数值:" value="${sysConfig.configValue}"></ui-form-input>
    </ui-form>
    </div>
</div>
<div>
    <a class="btn btn-sm btn-success" onclick="back()">返回</a>
</div>
<script>
    angular.module('myApp', ['ui.form']);
    angular.module('myApp').controller('ConfigCtrl', function ($scope) {
        var url = "system/sysconfig/update";
        $scope.nodeData = {};
        $scope.$on('ui.form.submit',function (event,param) {
            $.ajax({
                url:url,
                type:"post",
                data:param
            }).done(function (result) {
                if(result.code == '0000'){
                    toastr.success("更新成功");
                    if(opener && opener.reloadTable){
                        opener.reloadTable({});
                    }
                    setTimeout(function () {
                        window.location.href="system/sysconfig/index.htm";
                    },1500);
                }else{
                    toastr.error(result.msg);
                }
            }).fail(function (err) {

            });
        });
    });
    function back(){
        window.location.href="system/sysconfig/index.htm";
    }
</script>
</body>
</html>
